<script setup lang="ts">
import { formatDate } from '../../../utils/format'

export type ActivityCardPropsType = {
	imgUrl: string
	title: string
	publishDate: Date
	startDate: Date
	endDate: Date
	reserved: number
	rest: number
	point: number
	address: string
}
const props = defineProps<ActivityCardPropsType>()
</script>

<template>
	<view class="text-5">
		<nut-cell class="flex">
			<view>
				<image class="h-300 mr-2" :src="props.imgUrl"></image>
			</view>
			<view class="flex flex-col">
				{{props.title}}
				<text>发布时间:<text class="text-red">{{ formatDate(props.publishDate) }}</text></text>
				<text>活动开始:<text class="text-red">{{ formatDate(props.startDate) }}</text></text>
				<text>活动结束:<text class="text-red">{{ formatDate(props.endDate) }}</text></text>
				<text>已预约/限预约:<text class="text-red">{{ props.reserved }}/{{props.rest}}</text></text>
				<text>参与学分:<text class="text-red">{{props.point}}</text></text>
				<text>地点:<text class="text-red">{{props.address}}</text></text>
			</view>
		</nut-cell>
	</view>
</template>